﻿using SafoverWpfFw;
using System;
using System.Globalization;
using System.Windows;

namespace Safover.LidarCollector.Converter
{
    public class StringToVisibilityConverter : BaseValueConverter<StringToVisibilityConverter>
    {
        public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            string str = value as string;
            var visibility = string.IsNullOrEmpty(str) ? Visibility.Collapsed : Visibility.Visible;
            return visibility;
        }

        public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            return DependencyProperty.UnsetValue;
        }
    }
}
